<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.util.Util"%>
<%@page import="com.shsh.safemanage.model.Department1"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.util.Constants"%>

<%
String departName = request.getParameter(Constants.REQUEST_PARAMETER_DEPARTMENT_NAME);
if (departName == null) {
	departName = "";
}
departName = Util.isoToUTF8(departName);

String departTypeStr = request.getParameter(Constants.REQUEST_PARAMETER_DEPARTMENT_TYPE);
int departType = Constants.DEPARTMENT_TYPE_SHIYEBU;
try {
	departType = Integer.parseInt(departTypeStr);
} catch (Exception e) {
}

DepartmentDao departmentDao = DaoCreator.createDepartmentDao();
List<Department1> departList = departmentDao.getDepartment1List(departName, departType);
%>
<%
if (departList.size() > 0) {
%>
<table width="400" border="1" cellpadding="0"
		cellspacing="0">
	<%
	for (int i = 0; i < 100; i++) {
	%>
	<tr>
		<%
		for (int j = 0; j < 3; j++) {
			int index = i * 3 + j;
			if (index >= departList.size()) {
				break;
			}
			Department1 depart1 = departList.get(index);
		%>
		<td align="center"><a href="javascript:" onclick="chooseMappingDepartment1(<%=depart1.getId()%>)"><%=depart1.getDepartmentName()%></a></td>
		<%
		}
		%>
	</tr>
	<%
	}
	%>
</table>
<%
}
%>
